using System;
using System.ComponentModel.DataAnnotations;

namespace Domain
{
    /// <summary>
    /// 审计字段基类，所有领域实体都应继承此类
    /// </summary>
    public abstract class AuditableEntity
    {
        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime ?CreatedTime { get; set; } = DateTime.Now;

        /// <summary>
        /// 创建人ID
        /// </summary>
        public string ?CreatedBy { get; set; } = string.Empty;

        /// <summary>
        /// 最后修改时间
        /// </summary>
        public DateTime? LastModifiedTime { get; set; }

        /// <summary>
        /// 最后修改人ID
        /// </summary>
        public string ?LastModifiedBy { get; set; } = string.Empty;

        /// <summary>
        /// 删除标记（默认为false）
        /// </summary>
        public bool IsDeleted { get; set; } = false;

        /// <summary>
        /// 删除时间
        /// </summary>
        public DateTime? DeletedTime { get; set; }

        /// <summary>
        /// 删除人ID
        /// </summary>
        public string? DeletedBy { get; set; } = string.Empty;
    }
} 